package pers.lan.tl;

import com.deepoove.poi.XWPFTemplate;

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * @author <a href="mailto:1728209643@qq.com">lan</a>
 * @class WordTemplateTest
 * @date 2019-04-13 15:48
 */
public class WordTemplateTest {

    public static void main(String[] args) throws IOException {
        Map<String, String> map = new HashMap<>();
        map.put("company", "杭州质慧信息技术");
        map.put("tel", "15957156719");
        map.put("address", "杭州市江干区下沙学源街");
        XWPFTemplate template = XWPFTemplate.compile(Path.desktop + "template.docx").render(map);
        FileOutputStream out = new FileOutputStream(Path.desktop + "out_template.docx");
        template.write(out);
        out.flush();
        out.close();
        template.close();
    }
}
